package ev.dao;

import ev.traffic.Path;
import java.sql.Connection;
import java.util.*;

public class IDAOProxy implements IDAO{
		private DBConnection dbc = null;
		private IDAOImpl dao = null;
		public IDAOProxy(){
				this.dbc = new DBConnection();
				this.dao = new IDAOImpl(this.dbc.getConnection());
		}
		public List<Integer> findPathByNodes(int start,int end){
				List<Integer> list = null;
				try{
						list = this.dao.findPathByNodes(start,end);
				}catch(Exception e){
						e.printStackTrace();
				}
				return list;
		}
		public List<Path> findAll(int start){
				List<Path> list = null;
				try{
						list = this.dao.findAll(start);
				}catch(Exception e){
						e.printStackTrace();
				}
				return list;
		}
		public int findLengthByNodes(int start,int end){
				int result = 0;
				try{
						result = this.dao.findLengthByNodes(start,end);
				}catch(Exception e){
						e.printStackTrace();
				}
				return result;
		}
}
